﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using QzEbook.Admin;
using QzEbook.Common;
using QzEbook.View;

public partial class WebMaster : System.Web.UI.MasterPage
{
    public QzSiteMap sitemap = new QzSiteMap();
    public QzNavigator nav = new QzNavigator();
    public WebMaster()
    {
        Init += new EventHandler(masterInitHaner);
    }
    void masterInitHaner(object sender, EventArgs e)
    {
        QzSiteMapNode SMnode = new QzSiteMapNode("default.xhtml", "首页", "首页");
        sitemap.addChild(SMnode);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        defaultHander();
    }

    private void defaultHander()
    {
        

        NavNode Nnode = new NavNode("首页", "default.xhtml");
        Nnode.Templete = "<li><a href=\"{1}\"><b>{0}</b></a></li>";
        nav.addChild(Nnode);
        Nnode = new NavNode("电子书库", "list.xhtml");
        nav.addChild(Nnode);
        Nnode = new NavNode("标签", "tag.xhtml");
        nav.addChild(Nnode);
        NavBar.Text = nav.ToString();
    }

    protected override void Render(HtmlTextWriter writer)
    {
        sitemapLiteral.Text = sitemap.ToString();
        base.Render(writer);
    }
}
